package com.miku.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miku.blog.domain.TalkImages;
import com.miku.blog.service.TalkImagesService;
import com.miku.blog.mapper.TalkImagesMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Miku
* @description 针对表【tb_talk_images】的数据库操作Service实现
* @createDate 2022-06-10 11:43:09
*/
@Service
public class TalkImagesServiceImpl extends ServiceImpl<TalkImagesMapper, TalkImages>
    implements TalkImagesService{


    @Override
    public List<TalkImages> getTalkImageListByTalkId(Integer talkId){
        LambdaQueryWrapper<TalkImages> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TalkImages::getTalkId,talkId);
        List<TalkImages> talkImagesList = list(queryWrapper);
        return talkImagesList;
    }



    @Override
    public boolean delTalkImageByTalkId(Integer talkId){
        LambdaQueryWrapper<TalkImages> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TalkImages::getTalkId,talkId);
        return remove(queryWrapper);
    }

}




